import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  GlobalKey _key = GlobalKey<FormState>();
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    //根节点，只有一个
    return MaterialApp(
        debugShowCheckedModeBanner: false,
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: Scaffold(
          appBar: AppBar(
            title: Text("From Demo"),
          ),
          body: DecoratedBoxPage(),
        ));
  }
}

class DecoratedBoxPage extends StatelessWidget {
  const DecoratedBoxPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return DecoratedBox(
      decoration: BoxDecoration(
          boxShadow: [
            BoxShadow(
                color: Colors.black, offset: Offset(2.0, 2.0), blurRadius: 2)
          ],
          borderRadius: BorderRadius.circular(20.0),
          gradient:
              LinearGradient(colors: [Colors.red, Colors.yellow, Colors.blue])),
      child: Padding(
        padding: EdgeInsets.all(20.0),
        child: Text("data"),
      ),
    );
  }
}

